package com.pcbly.web.persistence.sms;
 
import com.pcbly.web.components.utils.random.GUID;
import com.pcbly.web.bean.sms.SmsConfigBean;
import com.pcbly.web.persistence.HibernateBaseDao;
 
public class SmsConfigHibernateDao extends HibernateBaseDao<SmsConfigBean> implements SmsConfigDao {
	/**
	 * 
	 */
	private static final long serialVersionUID = -6099559448648893739L;
	protected Class<SmsConfigBean> getEntityClass() {
		return SmsConfigBean.class;
	}

	public SmsConfigHibernateDao() {
		super();
	}
	@Override 
	public void saveSmsConfigBean(SmsConfigBean sms) throws Exception{
		if(logger.isDebugEnabled()){
			logger.debug(sms.getId());
		}
		String id=(new GUID()).toString();
		sms.setId(id);
		getHibernateTemplate().save(sms);
	}
	@Override
	public void removeSmsConfigBeanByIds(String ids) throws Exception {
		// TODO Auto-generated method stub
		ids = ids.replaceAll(",", "','");
		String hsql = "delete from t_sms_config where ID in( '" + ids + "')";
		getSession().createSQLQuery(hsql).executeUpdate();
		
	}
}